#ifndef PGSQL_H
#define PGSQL_H

typedef struct tagDBHandler
{
    PGconn *connection;
    ExecStatusType exec_status;
    PGresult *result;
    unsigned long affect_rows;  /*for insert, update, delete*/
    unsigned long tuples;       /*for select*/
    unsigned long fields;       /*for select*/
}DB_HANDLER_S;

int DB_Connect(DB_HANDLER_S *handler)
;
int DB_Exec(DB_HANDLER_S *handler, const char *command);
char *DB_Fetch(DB_HANDLER_S *handler, unsigned long tuple, unsigned long field);
void DB_Close(DB_HANDLER_S *handler);

#endif /* PGSQL_H */
